<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>双随机计划管理</title>
	<meta name="decorator" content="default"/>
	<script type="text/javascript">
		$(document).ready(function() {
			<c:if test="${empty drJh.id}">
				$('#jhMc').val("${sxMc}"+"-抽查计划");
			</c:if>
			$("#inputForm").validate({
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
		function dosubmit_(){ 
			$('#methodflag').val("1");
			$('#inputForm').submit();
		}
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li class="active"><a href="${ctx}/jh/drJh/form?id=${drJh.id}">检查计划<shiro:hasPermission name="jh:drJh:edit">${not empty drJh.id?'修改':'添加'}</shiro:hasPermission><shiro:lacksPermission name="jh:drJh:edit">查看</shiro:lacksPermission></a></li>
	</ul><br/>
	<form:form id="inputForm" modelAttribute="drJh" action="${ctx}/jh/drJh/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
        <form:hidden path="sxId"/>
        <form:hidden path="jhFdsx"/>
        <form:hidden path="officeZd" value="${fns:getUser().getOffice().id}"/>
        <input type="hidden" name="methodflag" id="methodflag" value="0"/>       
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">法定事项：</label>
			<div class="controls">
				${sxMc}
			</div>
		</div>        
		<div class="control-group">
			<label class="control-label">名称：</label>
			<div class="controls">
				<form:input path="jhMc" htmlEscape="false" maxlength="255" class="input-xxlarge required"/>
                <span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">制定部门：</label>
			<div class="controls">
            	<form:input path="officeZd.name" htmlEscape="false" maxlength="64" class="input-xlarge " value="${fns:getUser().getOffice()}" disabled="true"/>		
                <span class="help-inline"> 执法人员库人数：${rykNum}人，执法对象库数量：${dxkNum}个</span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">管理部门：</label>
			<div class="controls">
				<sys:treeselect id="officeGl" name="officeGl.id" value="${empty drJh.id?sx.officeGl.id:drJh.officeGl.id}" labelName="officeGl.name" labelValue="${empty drJh.id?sx.officeGl.name:drJh.officeGl.name}"
					title="部门" url="/sys/office/treeData?type=2" cssClass="input-xlarge" allowClear="true" notAllowSelectParent="false"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">执法小组数量：</label>
			<div class="controls">
				<form:input path="jhXzsl" htmlEscape="false" maxlength="11" class="input-xlarge  digits required"/>
                <span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">每组人数：</label>
			<div class="controls">
				<form:input path="jhMzrs" htmlEscape="false" maxlength="11" class="input-xlarge  digits required"/>
                <span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">抽取对象数目：</label>
			<div class="controls">
            	<form:radiobuttons path="jhDxcqfs" items="${fns:getDictList('dr_cqfs')}" itemLabel="label" itemValue="value" htmlEscape="false" class="required"/></br>
				<form:input path="jhDxcqsl" htmlEscape="false" maxlength="11" class="input-xlarge  digits required"/>
                <span class="help-inline"><font color="red">*</font> </span>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">预计任务数：</label>
			<div class="controls">
				<form:input path="jhSl" htmlEscape="false" maxlength="11" class="input-xlarge  digits" value="${not empty drJh.id?drJh.jhSl:1}"/>
                <span class="help-inline"> 此项检查要执行的次数</span>
			</div>
		</div>        
		<div class="control-group">
			<label class="control-label">备注信息：</label>
			<div class="controls">
				<form:textarea path="remarks" htmlEscape="false" rows="4" maxlength="255" class="input-xxlarge "/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="jh:drJh:edit">
            <input id="btnSubmit" class="btn btn-primary" type="submit" value="${not empty drJh.id?'保存':'生成'}计划"/>&nbsp;
            <input id="btnSubmit" class="btn btn-primary" type="button" value="${not empty drJh.id?'保存':'生成'}计划，并执行抽取" onClick="javascript:dosubmit_()"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onClick="history.go(-1)"/>            
		</div>
	</form:form>
</body>
</html>